package com.chanyachting.emall.service;








import java.util.List;

import org.hibernate.HibernateException;

import com.chanyachting.emall.domain.Companymember;
import com.chanyachting.emall.domain.Member;
import com.chanyachting.emall.exception.AccountExistException;
import com.chanyachting.emall.exception.AccountNotFoundException;
import com.chanyachting.emall.exception.EmailExistException;
import com.chanyachting.emall.exception.PasswordErrorException;

/**
 * <font color="#000000">��Ա���ܲ�����</font>
 * @author robert
 * @version 1.0
 * @updated 25-����-2009 14:48:24
 */
public interface MemberService {

	
	public static final String MEMBER_IN_SESSION="MEMBER_IN_SESSION";
	
	/**
	 * 
	 * @param member
	 * @throws AccountNotFoundException 
	 * @throws PasswordErrorException 
	 * @throws HibernateException 
	 */
	public Member login(Member member) throws AccountNotFoundException, PasswordErrorException, HibernateException;

	/**
	 * 
	 * @param member
	 * @throws AccountExistException 
	 * @throws EmailExistException 
	 * @throws HibernateException 
	 */
	public boolean regist(Member member) throws AccountExistException, EmailExistException, HibernateException;



	/**
	 * 
	 * @param member
	 * @throws HibernateException 
	 */
	public boolean updateMemberInfo(Member member) throws HibernateException;


	/**
	 * 
	 * @param newEmail
	 * @param member
	 * @throws HibernateException 
	 */
	public boolean updateMemberEmail(String newEmail, Member member) throws HibernateException;

	/**
	 * 
	 * @param password
	 * @param member
	 * @throws HibernateException 
	 */
	public boolean updatePassword(String newPassword, Member member) throws HibernateException;

	/**
	 * 
	 * @param account
	 * @throws HibernateException 
	 */
	public boolean checkAccount(String account) throws HibernateException;

	/**
	 * 
	 * @param email
	 * @throws HibernateException 
	 */
	public boolean checkEmail(String email) throws HibernateException;

	/**
	 * 
	 * @param password
	 * @param account
	 * @throws HibernateException 
	 */
	public boolean checkPassword(String password, String account) throws HibernateException;
	
	
	//检查会员是否是公司会员
	public boolean ifCompanyMember(Member member);
	
	//根据会员获得公司会员对象
	public Companymember getCompanyMemberByMember(Member member);
	
	
	//获得一个会员对象
	public Member getOneMember(Member member);
	
	
	//获得所有会员对象
	public List<Member> getAllMember();
	

	public Member registMember(Member member) throws AccountExistException, EmailExistException, HibernateException;

}